//调用接口配置文件
import { request } from 'config/request'

// 修改优惠券状态
export async function updateCoupon(params) {
	return request({
		url: 'admin/coupons/config/state',
		method: 'POST',
		data: params
	});
};

// 删除礼品
// export async function deleteGift(params) {
// 	return request({
// 		url: `admin/gift/delete/${params}`,
// 		method: 'GET',
// 		// data: params
// 	});
// };

// 导出优惠券
export async function exportCoupon(params) {
	return request({
		url: `admin/coupons/export/${params.couponsConfigId}`,
		method: 'GET',
		data: undefined
	});
};

// 导入优惠券
export async function importCoupon(params) {
	return request({
		url: 'admin/coupons/import',
		method: 'POST',
		headers: {
			"Content-type": "application/x-www-form-urlencoded"
		},
		data: params
	});
};

// 获取省市区
export async function queryAllAddress(params) {
    return request({
        url: 'admin/address/queryAllAddress',
        method: 'GET',
        data: params,
    });
};

//领取码验证
export async function checkCode(params) {
    return request({
        url: `admin/gift/verify/${params}`,
        method: 'GET',
        // data: params,
    });
};
//核销礼品码
export async function okVerific(params) {
    return request({
        url: 'admin/gift/confirm',
        method: 'POST',
        data: params,
    });
};